Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaces DeveloperError(s) with Check(s) in Ellipsoid #5425

Merged
merged 5 commits into from
Jun 9, 2017

Conversation

AnimatedRNG
Copy link
Contributor

Part of #4794

throw new DeveloperError('All radii components must be greater than or equal to zero.');
}
}*/
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this PR was submitted alongside #5424 it has some of the same issues. Do a pass over the file to make sure commented code is deleted, checks are within includeStart/includeEnd, and the appropriate Check.typeOf is used.

throw new DeveloperError('Ellipsoid must be an ellipsoid of revolution (radii.x == radii.y)');
}

Check.typeOf.number.greaterThan('_radii.z', this._radii.z, 0);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change the string to Ellipsoid.radii.z to better match the original error.

Check.defined('position', position);

// While it would be more idiomatic to use a Check.typeOf.number.something here,
// the resulting error message is a lot harder to read.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's fine to remove this comment.

@lilleyse
Copy link
Contributor

lilleyse commented Jun 6, 2017

@AnimatedRNG after making code updates just leave a small message like "Updated" so everyone reviewing gets notified.

@lilleyse
Copy link
Contributor

lilleyse commented Jun 6, 2017

There are still some areas with commented code and checks not within the debug pragmas.

@AnimatedRNG
Copy link
Contributor Author

Updated

@@ -283,12 +285,16 @@ define([
*/
Ellipsoid.pack = function(value, array, startingIndex) {
//>>includeStart('debug', pragmas.debug);
if (!defined(value)) {
/*if (!defined(value)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove comment.

if (!defined(cartesian)) {
throw new DeveloperError('cartesian is required.');
}
Check.defined('cartesian', cartesian);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use Check.typeOf.object here.

if (!defined(position)) {
throw new DeveloperError('position is required.');
}
Check.defined('position', position);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment.

@AnimatedRNG
Copy link
Contributor Author

Updated

@lilleyse
Copy link
Contributor

lilleyse commented Jun 9, 2017

Looks good!

@lilleyse lilleyse merged commit 1b92f28 into CesiumGS:master Jun 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants